3.13.97 \(\int x (a+b \arctan (c x)) (d+e \log (f+g x^2)) \, dx\) [1297]

3.13.97.1 Optimal result
3.13.97.2 Mathematica [B] (verified)
3.13.97.3 Rubi [A] (verified)
3.13.97.4 Maple [C] (warning: unable to verify)
3.13.97.5 Fricas [F]
3.13.97.6 Sympy [F(-1)]
3.13.97.7 Maxima [F]
3.13.97.8 Giac [F]
3.13.97.9 Mupad [F(-1)]

3.13.97.1 Optimal result

Integrand size = 22, antiderivative size = 562 \[ \int x (a+b \arctan (c x)) \left (d+e \log \left (f+g x^2\right )\right ) \, dx=-\frac {b (d-e) x}{2 c}+\frac {b e x}{c}+\frac {b (d-e) \arctan (c x)}{2 c^2}+\frac {1}{2} d x^2 (a+b \arctan (c x))-\frac {1}{2} e x^2 (a+b \arctan (c x))-\frac {b e \sqrt {f} \arctan \left (\frac {\sqrt {g} x}{\sqrt {f}}\right )}{c \sqrt {g}}-\frac {b e \left (c^2 f-g\right ) \arctan (c x) \log \left (\frac {2}{1-i c x}\right )}{c^2 g}+\frac {b e \left (c^2 f-g\right ) \arctan (c x) \log \left (\frac {2 c \left (\sqrt {-f}-\sqrt {g} x\right )}{\left (c \sqrt {-f}-i \sqrt {g}\right ) (1-i c x)}\right )}{2 c^2 g}+\frac {b e \left (c^2 f-g\right ) \arctan (c x) \log \left (\frac {2 c \left (\sqrt {-f}+\sqrt {g} x\right )}{\left (c \sqrt {-f}+i \sqrt {g}\right ) (1-i c x)}\right )}{2 c^2 g}-\frac {b e x \log \left (f+g x^2\right )}{2 c}-\frac {b e \left (c^2 f-g\right ) \arctan (c x) \log \left (f+g x^2\right )}{2 c^2 g}+\frac {e \left (f+g x^2\right ) (a+b \arctan (c x)) \log \left (f+g x^2\right )}{2 g}+\frac {i b e \left (c^2 f-g\right ) \operatorname {PolyLog}\left (2,1-\frac {2}{1-i c x}\right )}{2 c^2 g}-\frac {i b e \left (c^2 f-g\right ) \operatorname {PolyLog}\left (2,1-\frac {2 c \left (\sqrt {-f}-\sqrt {g} x\right )}{\left (c \sqrt {-f}-i \sqrt {g}\right ) (1-i c x)}\right )}{4 c^2 g}-\frac {i b e \left (c^2 f-g\right ) \operatorname {PolyLog}\left (2,1-\frac {2 c \left (\sqrt {-f}+\sqrt {g} x\right )}{\left (c \sqrt {-f}+i \sqrt {g}\right ) (1-i c x)}\right )}{4 c^2 g} \]

output
-1/2*b*(d-e)*x/c+b*e*x/c+1/2*b*(d-e)*arctan(c*x)/c^2+1/2*d*x^2*(a+b*arctan 
(c*x))-1/2*e*x^2*(a+b*arctan(c*x))-b*e*(c^2*f-g)*arctan(c*x)*ln(2/(1-I*c*x 
))/c^2/g-1/2*b*e*x*ln(g*x^2+f)/c-1/2*b*e*(c^2*f-g)*arctan(c*x)*ln(g*x^2+f) 
/c^2/g+1/2*e*(g*x^2+f)*(a+b*arctan(c*x))*ln(g*x^2+f)/g+1/2*b*e*(c^2*f-g)*a 
rctan(c*x)*ln(2*c*((-f)^(1/2)-x*g^(1/2))/(1-I*c*x)/(c*(-f)^(1/2)-I*g^(1/2) 
))/c^2/g+1/2*b*e*(c^2*f-g)*arctan(c*x)*ln(2*c*((-f)^(1/2)+x*g^(1/2))/(1-I* 
c*x)/(c*(-f)^(1/2)+I*g^(1/2)))/c^2/g+1/2*I*b*e*(c^2*f-g)*polylog(2,1-2/(1- 
I*c*x))/c^2/g-1/4*I*b*e*(c^2*f-g)*polylog(2,1-2*c*((-f)^(1/2)-x*g^(1/2))/( 
1-I*c*x)/(c*(-f)^(1/2)-I*g^(1/2)))/c^2/g-1/4*I*b*e*(c^2*f-g)*polylog(2,1-2 
*c*((-f)^(1/2)+x*g^(1/2))/(1-I*c*x)/(c*(-f)^(1/2)+I*g^(1/2)))/c^2/g-b*e*ar 
ctan(x*g^(1/2)/f^(1/2))*f^(1/2)/c/g^(1/2)
 
3.13.97.2 Mathematica [B] (verified)

Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(1140\) vs. \(2(562)=1124\).

Time = 6.75 (sec) , antiderivative size = 1140, normalized size of antiderivative = 2.03 \[ \int x (a+b \arctan (c x)) \left (d+e \log \left (f+g x^2\right )\right ) \, dx=\frac {-2 b c d g x+6 b c e g x+2 a c^2 d g x^2-2 a c^2 e g x^2+2 b d g \arctan (c x)-2 b e g \arctan (c x)+2 b c^2 d g x^2 \arctan (c x)-2 b c^2 e g x^2 \arctan (c x)-4 b c e \sqrt {f} \sqrt {g} \arctan \left (\frac {\sqrt {g} x}{\sqrt {f}}\right )+4 i b c^2 e f \arcsin \left (\sqrt {\frac {c^2 f}{c^2 f-g}}\right ) \arctan \left (\frac {c g x}{\sqrt {c^2 f g}}\right )-4 i b e g \arcsin \left (\sqrt {\frac {c^2 f}{c^2 f-g}}\right ) \arctan \left (\frac {c g x}{\sqrt {c^2 f g}}\right )-4 b c^2 e f \arctan (c x) \log \left (1+e^{2 i \arctan (c x)}\right )+4 b e g \arctan (c x) \log \left (1+e^{2 i \arctan (c x)}\right )+2 b c^2 e f \arcsin \left (\sqrt {\frac {c^2 f}{c^2 f-g}}\right ) \log \left (\frac {c^2 \left (1+e^{2 i \arctan (c x)}\right ) f+\left (-1+e^{2 i \arctan (c x)}\right ) g-2 e^{2 i \arctan (c x)} \sqrt {c^2 f g}}{c^2 f-g}\right )-2 b e g \arcsin \left (\sqrt {\frac {c^2 f}{c^2 f-g}}\right ) \log \left (\frac {c^2 \left (1+e^{2 i \arctan (c x)}\right ) f+\left (-1+e^{2 i \arctan (c x)}\right ) g-2 e^{2 i \arctan (c x)} \sqrt {c^2 f g}}{c^2 f-g}\right )+2 b c^2 e f \arctan (c x) \log \left (\frac {c^2 \left (1+e^{2 i \arctan (c x)}\right ) f+\left (-1+e^{2 i \arctan (c x)}\right ) g-2 e^{2 i \arctan (c x)} \sqrt {c^2 f g}}{c^2 f-g}\right )-2 b e g \arctan (c x) \log \left (\frac {c^2 \left (1+e^{2 i \arctan (c x)}\right ) f+\left (-1+e^{2 i \arctan (c x)}\right ) g-2 e^{2 i \arctan (c x)} \sqrt {c^2 f g}}{c^2 f-g}\right )-2 b c^2 e f \arcsin \left (\sqrt {\frac {c^2 f}{c^2 f-g}}\right ) \log \left (1+\frac {e^{2 i \arctan (c x)} \left (c^2 f+g+2 \sqrt {c^2 f g}\right )}{c^2 f-g}\right )+2 b e g \arcsin \left (\sqrt {\frac {c^2 f}{c^2 f-g}}\right ) \log \left (1+\frac {e^{2 i \arctan (c x)} \left (c^2 f+g+2 \sqrt {c^2 f g}\right )}{c^2 f-g}\right )+2 b c^2 e f \arctan (c x) \log \left (1+\frac {e^{2 i \arctan (c x)} \left (c^2 f+g+2 \sqrt {c^2 f g}\right )}{c^2 f-g}\right )-2 b e g \arctan (c x) \log \left (1+\frac {e^{2 i \arctan (c x)} \left (c^2 f+g+2 \sqrt {c^2 f g}\right )}{c^2 f-g}\right )+2 a c^2 e f \log \left (f+g x^2\right )-2 b c e g x \log \left (f+g x^2\right )+2 a c^2 e g x^2 \log \left (f+g x^2\right )+2 b e g \arctan (c x) \log \left (f+g x^2\right )+2 b c^2 e g x^2 \arctan (c x) \log \left (f+g x^2\right )+2 i b e \left (c^2 f-g\right ) \operatorname {PolyLog}\left (2,-e^{2 i \arctan (c x)}\right )-i b e \left (c^2 f-g\right ) \operatorname {PolyLog}\left (2,\frac {e^{2 i \arctan (c x)} \left (-c^2 f-g+2 \sqrt {c^2 f g}\right )}{c^2 f-g}\right )-i b c^2 e f \operatorname {PolyLog}\left (2,-\frac {e^{2 i \arctan (c x)} \left (c^2 f+g+2 \sqrt {c^2 f g}\right )}{c^2 f-g}\right )+i b e g \operatorname {PolyLog}\left (2,-\frac {e^{2 i \arctan (c x)} \left (c^2 f+g+2 \sqrt {c^2 f g}\right )}{c^2 f-g}\right )}{4 c^2 g} \]

input
Integrate[x*(a + b*ArcTan[c*x])*(d + e*Log[f + g*x^2]),x]
 
output
(-2*b*c*d*g*x + 6*b*c*e*g*x + 2*a*c^2*d*g*x^2 - 2*a*c^2*e*g*x^2 + 2*b*d*g* 
Ar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^2*f - g)]]* 
Log[1 + (E^((2*I)*ArcTan[c*x])*(c^2*f + g + 2*Sqrt[c^2*f*g]))/(c^2*f - g)] 
 + 2*b*e*g*ArcSin[Sqrt[(c^2*f)/(c^2*f - g)]]*Log[1 + (E^((2*I)*ArcTan[c*x] 
)*(c^2*f + g + 2*Sqrt[c^2*f*g]))/(c^2*f - g)] + 2*b*c^2*e*f*ArcTan[c*x]*Lo 
g[1 + (E^((2*I)*ArcTan[c*x])*(c^2*f + g + 2*Sqrt[c^2*f*g]))/(c^2*f - g)...
 
3.13.97.3 Rubi [A] (verified)

Time = 0.89 (sec) , antiderivative size = 554, normalized size of antiderivative = 0.99, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.091, Rules used = {5554, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int x (a+b \arctan (c x)) \left (d+e \log \left (f+g x^2\right )\right ) \, dx\)

\(\Big \downarrow \) 5554

\(\displaystyle -b c \int \left (\frac {(d-e) x^2}{2 \left (c^2 x^2+1\right )}+\frac {e \left (g x^2+f\right ) \log \left (g x^2+f\right )}{2 g \left (c^2 x^2+1\right )}\right )dx+\frac {1}{2} d x^2 (a+b \arctan (c x))+\frac {e \left (f+g x^2\right ) \log \left (f+g x^2\right ) (a+b \arctan (c x))}{2 g}-\frac {1}{2} e x^2 (a+b \arctan (c x))\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {1}{2} d x^2 (a+b \arctan (c x))+\frac {e \left (f+g x^2\right ) \log \left (f+g x^2\right ) (a+b \arctan (c x))}{2 g}-\frac {1}{2} e x^2 (a+b \arctan (c x))-b c \left (-\frac {(d-e) \arctan (c x)}{2 c^3}+\frac {e \sqrt {f} \arctan \left (\frac {\sqrt {g} x}{\sqrt {f}}\right )}{c^2 \sqrt {g}}+\frac {e \arctan (c x) \left (c^2 f-g\right ) \log \left (f+g x^2\right )}{2 c^3 g}+\frac {e \arctan (c x) \left (c^2 f-g\right ) \log \left (\frac {2}{1-i c x}\right )}{c^3 g}-\frac {e \arctan (c x) \left (c^2 f-g\right ) \log \left (\frac {2 c \left (\sqrt {-f}-\sqrt {g} x\right )}{(1-i c x) \left (c \sqrt {-f}-i \sqrt {g}\right )}\right )}{2 c^3 g}-\frac {e \arctan (c x) \left (c^2 f-g\right ) \log \left (\frac {2 c \left (\sqrt {-f}+\sqrt {g} x\right )}{(1-i c x) \left (c \sqrt {-f}+i \sqrt {g}\right )}\right )}{2 c^3 g}+\frac {x (d-e)}{2 c^2}+\frac {e x \log \left (f+g x^2\right )}{2 c^2}-\frac {e x}{c^2}-\frac {i e \left (c^2 f-g\right ) \operatorname {PolyLog}\left (2,1-\frac {2}{1-i c x}\right )}{2 c^3 g}+\frac {i e \left (c^2 f-g\right ) \operatorname {PolyLog}\left (2,1-\frac {2 c \left (\sqrt {-f}-\sqrt {g} x\right )}{\left (c \sqrt {-f}-i \sqrt {g}\right ) (1-i c x)}\right )}{4 c^3 g}+\frac {i e \left (c^2 f-g\right ) \operatorname {PolyLog}\left (2,1-\frac {2 c \left (\sqrt {g} x+\sqrt {-f}\right )}{\left (\sqrt {-f} c+i \sqrt {g}\right ) (1-i c x)}\right )}{4 c^3 g}\right )\)

input
Int[x*(a + b*ArcTan[c*x])*(d + e*Log[f + g*x^2]),x]
 
output
(d*x^2*(a + b*ArcTan[c*x]))/2 - (e*x^2*(a + b*ArcTan[c*x]))/2 + (e*(f + g* 
x^2)*(a + b*ArcTan[c*x])*Log[f + g*x^2])/(2*g) - b*c*(((d - e)*x)/(2*c^2) 
- (e*x)/c^2 - ((d - e)*ArcTan[c*x])/(2*c^3) + (e*Sqrt[f]*ArcTan[(Sqrt[g]*x 
)/Sqrt[f]])/(c^2*Sqrt[g]) + (e*(c^2*f - g)*ArcTan[c*x]*Log[2/(1 - I*c*x)]) 
/(c^3*g) - (e*(c^2*f - g)*ArcTan[c*x]*Log[(2*c*(Sqrt[-f] - Sqrt[g]*x))/((c 
*Sqrt[-f] - I*Sqrt[g])*(1 - I*c*x))])/(2*c^3*g) - (e*(c^2*f - g)*ArcTan[c* 
x]*Log[(2*c*(Sqrt[-f] + Sqrt[g]*x))/((c*Sqrt[-f] + I*Sqrt[g])*(1 - I*c*x)) 
])/(2*c^3*g) + (e*x*Log[f + g*x^2])/(2*c^2) + (e*(c^2*f - g)*ArcTan[c*x]*L 
og[f + g*x^2])/(2*c^3*g) - ((I/2)*e*(c^2*f - g)*PolyLog[2, 1 - 2/(1 - I*c* 
x)])/(c^3*g) + ((I/4)*e*(c^2*f - g)*PolyLog[2, 1 - (2*c*(Sqrt[-f] - Sqrt[g 
]*x))/((c*Sqrt[-f] - I*Sqrt[g])*(1 - I*c*x))])/(c^3*g) + ((I/4)*e*(c^2*f - 
 g)*PolyLog[2, 1 - (2*c*(Sqrt[-f] + Sqrt[g]*x))/((c*Sqrt[-f] + I*Sqrt[g])* 
(1 - I*c*x))])/(c^3*g))
 

3.13.97.3.1 Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 5554
Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))*((d_.) + Log[(f_.) + (g_.)*(x_)^2]*( 
e_.))*(x_)^(m_.), x_Symbol] :> With[{u = IntHide[x^m*(d + e*Log[f + g*x^2]) 
, x]}, Simp[(a + b*ArcTan[c*x])   u, x] - Simp[b*c   Int[ExpandIntegrand[u/ 
(1 + c^2*x^2), x], x], x]] /; FreeQ[{a, b, c, d, e, f, g}, x] && IGtQ[(m + 
1)/2, 0]
 
3.13.97.4 Maple [C] (warning: unable to verify)

Result contains higher order function than in optimal. Order 9 vs. order 4.

Time = 13.54 (sec) , antiderivative size = 10102, normalized size of antiderivative = 17.98

method result size
default \(\text {Expression too large to display}\) \(10102\)
parts \(\text {Expression too large to display}\) \(10102\)

input
int(x*(a+b*arctan(c*x))*(d+e*ln(g*x^2+f)),x,method=_RETURNVERBOSE)
 
output
result too large to display
 
3.13.97.5 Fricas [F]

\[ \int x (a+b \arctan (c x)) \left (d+e \log \left (f+g x^2\right )\right ) \, dx=\int { {\left (b \arctan \left (c x\right ) + a\right )} {\left (e \log \left (g x^{2} + f\right ) + d\right )} x \,d x } \]

input
integrate(x*(a+b*arctan(c*x))*(d+e*log(g*x^2+f)),x, algorithm="fricas")
 
output
integral(b*d*x*arctan(c*x) + a*d*x + (b*e*x*arctan(c*x) + a*e*x)*log(g*x^2 
 + f), x)
 
3.13.97.6 Sympy [F(-1)]

Timed out. \[ \int x (a+b \arctan (c x)) \left (d+e \log \left (f+g x^2\right )\right ) \, dx=\text {Timed out} \]

input
integrate(x*(a+b*atan(c*x))*(d+e*ln(g*x**2+f)),x)
 
output
Timed out
 
3.13.97.7 Maxima [F]

\[ \int x (a+b \arctan (c x)) \left (d+e \log \left (f+g x^2\right )\right ) \, dx=\int { {\left (b \arctan \left (c x\right ) + a\right )} {\left (e \log \left (g x^{2} + f\right ) + d\right )} x \,d x } \]

input
integrate(x*(a+b*arctan(c*x))*(d+e*log(g*x^2+f)),x, algorithm="maxima")
 
output
1/2*a*d*x^2 + 1/2*(x^2*arctan(c*x) - c*(x/c^2 - arctan(c*x)/c^3))*b*d - 1/ 
2*(g*x^2 - (g*x^2 + f)*log(g*x^2 + f) + f)*a*e/g - 1/2*(2*c*f*arctan(g*x/s 
qrt(f*g)) + (4*c^4*g*integrate(1/2*x^3*arctan(c*x)/(c^2*g*x^2 + c^2*f), x) 
 + 4*c^2*g*integrate(1/2*x*arctan(c*x)/(c^2*g*x^2 + c^2*f), x) - 2*c*x + ( 
c*x - (c^2*x^2 + 1)*arctan(c*x))*log(g*x^2 + f))*sqrt(f*g))*b*e/(sqrt(f*g) 
*c^2)
 
3.13.97.8 Giac [F]

\[ \int x (a+b \arctan (c x)) \left (d+e \log \left (f+g x^2\right )\right ) \, dx=\int { {\left (b \arctan \left (c x\right ) + a\right )} {\left (e \log \left (g x^{2} + f\right ) + d\right )} x \,d x } \]

input
integrate(x*(a+b*arctan(c*x))*(d+e*log(g*x^2+f)),x, algorithm="giac")
 
output
sage0*x
 
3.13.97.9 Mupad [F(-1)]

Timed out. \[ \int x (a+b \arctan (c x)) \left (d+e \log \left (f+g x^2\right )\right ) \, dx=\int x\,\left (a+b\,\mathrm {atan}\left (c\,x\right )\right )\,\left (d+e\,\ln \left (g\,x^2+f\right )\right ) \,d x \]

input
int(x*(a + b*atan(c*x))*(d + e*log(f + g*x^2)),x)
 
output
int(x*(a + b*atan(c*x))*(d + e*log(f + g*x^2)), x)